
<%@ page language="java" %>
<%@ page import="com.scalar.chiptrack.users.NotificationSetup,
                 com.scalar.chiptrack.utils.ConfigManager,
                 com.scalar.chiptrack.commons.Constants"%>

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/chiptrack-tags.tld" prefix="chiptrack" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>

<chiptrack:checkLogon sourcePage="/notificationSetup.do"/>

<HTML><HEAD><TITLE>Scalarsoft - ChipTrac</TITLE>

<%String chipTracContext = "/" + ConfigManager.getChipTracContext();%>

<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<LINK href="<%=chipTracContext%>/jsp/includes/stylesheets/scalarsoft.css" type=text/css rel=stylesheet>

<META content="MSHTML 5.50.4807.2300" name=GENERATOR></HEAD>
<BODY bgColor="#ffffff" leftMargin=0 topMargin=0 marginheight="0" marginwidth="0">

<SCRIPT language="JavaScript" src="<%=chipTracContext%>/jsp/includes/scripts/functions.js">
</script>


<SCRIPT>
function isDuplicatesPresent ( emails )
{
    if ( emails.length == null )
    {
        return false;
    }
    for ( i =0; i< emails.length; i++ )
    {
        var cnt = 0;
        var email =  trim ( emails[i].value )
       if ( email != '' )
       {
            for ( j=0; j< emails.length; j++ )
            {
                var email2= trim ( emails[j].value )
                if ( email.toUpperCase() == email2.toUpperCase() )
                {
                    cnt = cnt + 1;
                }
                if ( cnt > 1 )
                {
                    emails[i].select();
                    emails[i].focus();
                    return true;
                }
            }
        }
    }
    return false;
}
function saveEmails() {
    var pa = document.getElementById("errors");
    pa.innerHTML = "";
    var error = "";
    if ( isDuplicatesPresent ( notificationSetupForm.approvedSOEmails ) )
    {
        error = error + "<li>Approved Sales Order Information Emails has Duplicates</li>"
        pa.innerHTML = error;
    }
    if ( isDuplicatesPresent ( notificationSetupForm.packingSlipEmail ) )
    {
        error = error + "<li>Generated Packingslips Emails has Duplicates</li>"
        pa.innerHTML = error;
    }
    if ( isDuplicatesPresent ( notificationSetupForm.adaptorLogEmail ) )
    {
        error = error + "<li>Adaptor logs and errors Emails has Duplicates</li>"
        pa.innerHTML = error;
    }
    if ( isDuplicatesPresent ( notificationSetupForm.shipAlertEmail ) )
    {
        error = error + "<li>Ship Alert Emails has Duplicates</li>"
        pa.innerHTML = error;
    }
    if ( isDuplicatesPresent ( notificationSetupForm.salesOrderEmail ) )
    {
        error = error + "<li>Sales Order Notification Emails has Duplicates</li>"
        pa.innerHTML = error;
    }
    //if ( isDuplicatesPresent ( notificationSetupForm.programReleaseEmail ) )
    //{
      //  error = error + "<li>Program Release Notification Emails has Duplicates</li>"
       // pa.innerHTML = error;
    //}
    if ( isDuplicatesPresent ( notificationSetupForm.assemblyReleaseEmail ) )
    {
        error = error + "<li>Assembly Release Notification Emails has Duplicates</li>"
        pa.innerHTML = error;
    }
	if ( isDuplicatesPresent ( notificationSetupForm.newLotEmail ) )
    {
        error = error + "<li>Lot Flow Notification Emails has Duplicates</li>"
        pa.innerHTML = error;
    }
    if ( pa.innerHTML != '' )
    {
        return;
    }
    document.notificationSetupForm.action = '<%=chipTracContext%>/notificationSetup.do?action=save';
    document.notificationSetupForm.submit();
}

function newEmail(fieldName, fontId) {
    var htmltext1 = '<table width="100%"><tr><td><input type="text" name="' + fieldName + '" size="50" maxlength="100" class="txfield"></td></tr></table>';
    var pa1 = document.getElementById (fontId);
    pa1.insertAdjacentHTML ('BeforeEnd',htmltext1);
}
</SCRIPT>

<!-- Top Header Start-->
<%@ include file="/jsp/includes/header.jsp" %>
<!-- Top Header End-->
  
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  <TBODY>
  <TR>
    <td width='180' valign='top' background='<%=chipTracContext%>/jsp/includes/images/left_red_bg.gif'>

<!-- Side Navigation start -->
<%@ include file="/jsp/admin/admin_menu.jsp" %>
<!-- end of the side navigations -->
</TD>

<TD bgcolor="#ffffff">
<IMG height=9 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=8></TD>
<TD bgcolor="#ffffff"><IMG height=480 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=2></TD>
<TD valign="top" width="100%">

<IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/clear.gif" width=500 border=0>
<BR>

<!-- from here your body starts -->
<span class="NArialW">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Email Notifications Setup
</span>

<img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20>

<%
    // NotificationSetup Action creates it and adds it to the request
    NotificationSetup notificationSetup = (NotificationSetup) request.getAttribute ("notificationSetup");
    if (notificationSetup == null) notificationSetup = new NotificationSetup();
%>

<html:form name="notificationSetupForm" type="com.scalar.chiptrack.ChipTrackActionForm" action="/notificationSetup.do?action=save">

    <table border="1" width="90%" bordercolor="#FFFFFF" align="center">
        
        <tr><td colspan='2'><chiptrack:info styleClass='NArialL'/></td></tr>
        <tr><td colspan='2'><chiptrack:errors styleClass='NArialL'/></td></tr>
        <logic:equal name="showMessage" value="TRUE">
            <tr><td colspan=2 align='left'>
            <font class='NArialS'>
            <font color='blue'><b><%=Constants.NO_MODIFY_RIGHTS %></b>
            </font></td></tr>
        </logic:equal>
        <tr><td colspan='2' align="left" class='NArialL'><FONT id="errors" styleClass="NArialL" color='FF0000'></FONT></td></tr>
        <tr><td colspan='2'><img height=10 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif"></td></tr>
        <!--Commented by KumaraSwamy on Sep 1st, 2004-->
        <!--tr>
            <td bgcolor='#DEE1E2' align='left'><font class="NArialL">&nbsp;&nbsp;Engineering Pull:</font></td>
            <td align='left' valign='center'>
                <table>
                <-%
                    String[] engPullEmails = notificationSetup.getEngPullEmails();
                    if ((engPullEmails == null) || (engPullEmails.length == 0)) {
                %>
                    <tr><td>
                        <input type="text" name="engineeringPullEmail" size="50" maxlength='100' class="txfield">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <a href="javascript:newEmail('engineeringPullEmail', 'font1')"><img border="0" src="<-%=chipTracContext%>/jsp/includes/images/addmore.gif" width="65" height="17" onMouseOver="window.status='Click to Add Notification Email';return true" onMouseout="window.status='';return true" title="Click here to Add Notification Email" ></a>
                    </tr></td>
                <-%
                    }
                    else {
                        for (int i=0; i<engPullEmails.length; i++) {
                            if (engPullEmails[i] != null) {
                %>
                            <tr><td><input type="text" name="engineeringPullEmail" value='<-%=engPullEmails[i]%>' size="50" maxlength='100' class="txfield">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <-%
                        if (i == 0) {
                %>
                            <a href="javascript:newEmail('engineeringPullEmail', 'font1')"><img border="0" src="<-%=chipTracContext%>/jsp/includes/images/addmore.gif" width="65" height="17" onMouseOver="window.status='Click to Add Notification Email';return true" onMouseout="window.status='';return true" title="Click here to Add Notification Email"></a>
                <-%
                        }
                %>
                    </tr></td>
                <-%
                            }
                        }
                    }
                %>
                </table>
            </td>
        </tr>

        <tr>
            <td align='left'><font class='NArialL'>&nbsp;</font></td>
            <td align='left' valign='center'><font id="font1"></font></td>
        </tr>

        <tr><td colspan=2><img src="<-%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20></td></tr>

        <tr>
            <td bgcolor='#DEE1E2' align='left'><font class="NArialL">&nbsp;&nbsp;Engineering Return:</font></td>
            <td align='left' valign='center'>
                <table>
                <-%
                    String[] engReturnEmails = notificationSetup.getEngReturnEmails();
                    if ((engReturnEmails == null) || (engReturnEmails.length == 0)) {
                %>
                        <tr><td>
                            <input type="text" name="engineeringReturnEmail" size="50" maxlength='100' class="txfield">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <a href="javascript:newEmail('engineeringReturnEmail', 'font2')"><img border="0" src="<-%=chipTracContext%>/jsp/includes/images/addmore.gif" width="65" height="17" onMouseOver="window.status='Click to Add Notification Email';return true" onMouseout="window.status='';return true" title="Click here to Add Notification Email"></a>
                        </td></tr>
                <-%
                    }
                    else {
                        for (int i=0; i<engReturnEmails.length; i++) {
                            if (engReturnEmails[i] != null) {
                %>
                                <tr><td><input type="text" name="engineeringReturnEmail" value='<-%=engReturnEmails[i]%>' size="50" maxlength='100' class="txfield">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <-%
                                if (i == 0) {
                %>
                                    <a href="javascript:newEmail('engineeringReturnEmail', 'font2')"><img border="0" src="<-%=chipTracContext%>/jsp/includes/images/addmore.gif" width="65" height="17" onMouseOver="window.status='Click to Add Notification Email';return true" onMouseout="window.status='';return true" title="Click here to Add Notification Email"></a>
                <-%
                                }
                %>
                                </td></tr>
                <-%
                            }
                        }
                    }
                %>

                </table>
            </td>
        </tr>

        <tr>
            <td align='left'><font class='NArialL'>&nbsp;</font></td>
            <td align='left' valign='center'><font id="font2"></font></td>
        </tr-->
       <!--End of the Comments by KumaraSwamy 0n Sep 1st, 2004-->
        <tr><td colspan=2><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20></td></tr>

        <tr>
            <td bgcolor='#DEE1E2' align='left'><font class="NArialL">&nbsp;&nbsp;Send Approved Sales<br>&nbsp;&nbsp;Order Information to:</font></td>
            <td align='left' valign='center'>
                <table>
                <%
                    String[] approvedSOEmails = notificationSetup.getApprovedSOEmails();
                    if ((approvedSOEmails == null) || (approvedSOEmails.length == 0)) {
                %>
                        <tr><td>
                            <input type="text" name="approvedSOEmails" size="50" maxlength='100' class="txfield">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <a href="javascript:newEmail('approvedSOEmails', 'font3')"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/addmore.gif" width="65" height="17" onMouseOver="window.status='Click to Add Notification Email';return true" onMouseout="window.status='';return true" title="Click here to Add Notification Email"></a>
                        </td></tr>
                <%
                    }
                    else {
                            int count = 0;
                            for (int i=0; i<approvedSOEmails.length; i++) {
                            if ( approvedSOEmails[i] != null && ( !"".equals(approvedSOEmails[i].trim()) ) )
                            {
                                count++;
                %>
                                <tr><td><input type="text" name="approvedSOEmails" value='<%=approvedSOEmails[i]%>' size="50" maxlength='100' class="txfield">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <%
                                if ( count > 1 )
                                {
                %>
                                    </td></tr>
                <%
                                }
                            }
                            if ( count == 1 )
                            {    count++;
                %>
                                <a href="javascript:newEmail('approvedSOEmails', 'font3')"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/addmore.gif" width="65" height="17" onMouseOver="window.status='Click to Add Notification Email';return true" onMouseout="window.status='';return true" title="Click here to Add Notification Email"></a>
                                </td></tr>
                <%
                            }
                        }
                        if (count == 0)
                        {
                %>
                            <tr><td><input type="text" name="approvedSOEmails" size="50" maxlength='100' class="txfield">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                             <a href="javascript:newEmail('approvedSOEmails', 'font3')"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/addmore.gif" width="65" height="17" onMouseOver="window.status='Click to Add Notification Email';return true" onMouseout="window.status='';return true" title="Click here to Add Notification Email"></a>
                             </td></tr>
                <%
                        }
                    }
                %>

                </table>
            </td>
        </tr>

        <tr>
            <td align='left'><font class='NArialL'>&nbsp;</font></td>
            <td align='left' valign='center'><font id="font3"></font></td>
        </tr>

        <tr><td colspan=2><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20></td></tr>

        <tr>
            <td bgcolor='#DEE1E2' align='left' width='150'><font class="NArialL">&nbsp;&nbsp;Send Generated<br>&nbsp;&nbsp;Packingslips to:</font></td>
            <td align='left' valign='center'>
                <table>
                <%
                    String[] packingSlipEmails = notificationSetup.getPackingSlipEmails();
                    if ((packingSlipEmails == null) || (packingSlipEmails.length == 0)) {
                %>
                        <tr><td>
                            <input type="text" name="packingSlipEmail" size="50" maxlength='100' class="txfield">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <a href="javascript:newEmail('packingSlipEmail', 'font4')"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/addmore.gif" width="65" height="17" onMouseOver="window.status='Click to Add Notification Email';return true" onMouseout="window.status='';return true" title="Click here to Add Notification Email"></a>
                        </td></tr>
                <%
                    }
                    else {
                            int count = 0;
                            for (int i=0; i<packingSlipEmails.length; i++) {
                            if ( packingSlipEmails[i] != null && ( !"".equals(packingSlipEmails[i].trim()) ) )
                            {
                                count++;
                %>
                                <tr><td><input type="text" name="packingSlipEmail" value='<%=packingSlipEmails[i]%>' size="50" maxlength='100' class="txfield">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <%
                                if ( count > 1 )
                                {
                %>
                                    </td></tr>
                <%
                                }
                            }
                            if ( count == 1 )
                            {    count++;
                %>
                                <a href="javascript:newEmail('packingSlipEmail', 'font4')"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/addmore.gif" width="65" height="17" onMouseOver="window.status='Click to Add Notification Email';return true" onMouseout="window.status='';return true" title="Click here to Add Notification Email"></a>
                                </td></tr>
                <%
                            }
                        }
                        if (count == 0)
                        {
                %>
                            <tr><td><input type="text" name="packingSlipEmail" size="50" maxlength='100' class="txfield">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                             <a href="javascript:newEmail('packingSlipEmail', 'font4')"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/addmore.gif" width="65" height="17" onMouseOver="window.status='Click to Add Notification Email';return true" onMouseout="window.status='';return true" title="Click here to Add Notification Email"></a>
                             </td></tr>
                <%
                        }
                    }
                %>

                </table>
            </td>
        </tr>

        <tr>
            <td align='left'><font class='NArialL'>&nbsp;</font></td>
            <td align='left' valign='center'><font id="font4"></font></td>
        </tr>


        <tr><td colspan=2><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20></td></tr>

        <tr>
            <td bgcolor='#DEE1E2' align='left' width='150'><font class="NArialL">&nbsp;&nbsp;Send Adaptor logs<br>&nbsp;&nbsp;and errors to:</font></td>
            <td align='left' valign='center'>
                <table>
                <%
                    String[] adaptorLogEmails = notificationSetup.getAdaptorLogEmails();
                    if ((adaptorLogEmails == null) || (adaptorLogEmails.length == 0)) {
                %>
                        <tr><td>
                            <input type="text" name="adaptorLogEmail" size="50" maxlength='100' class="txfield">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <a href="javascript:newEmail('adaptorLogEmail', 'font5')"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/addmore.gif" width="65" height="17" onMouseOver="window.status='Click to Add Notification Email';return true" onMouseout="window.status='';return true" title="Click here to Add Notification Email"></a>
                        </td></tr>
                <%
                    }
                    else {
                            int count = 0;
                            for (int i=0; i<adaptorLogEmails.length; i++) {
                            if ( adaptorLogEmails[i] != null && ( !"".equals(adaptorLogEmails[i].trim()) ) )
                            {
                                count++;

                %>
                                <tr><td><input type="text" name="adaptorLogEmail" value='<%=adaptorLogEmails[i]%>' size="50" maxlength='100' class="txfield">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <%
                                if ( count > 1 )
                                {
                %>
                                    </td></tr>
                <%
                                }
                            }
                            if ( count == 1 )
                            {   count++;
                %>
                                <a href="javascript:newEmail('adaptorLogEmail', 'font5')"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/addmore.gif" width="65" height="17" onMouseOver="window.status='Click to Add Notification Email';return true" onMouseout="window.status='';return true" title="Click here to Add Notification Email"></a>
                                </td></tr>
                <%
                            }
                        }
                        if (count == 0)
                        {
                %>
                            <tr><td><input type="text" name="adaptorLogEmail" size="50" maxlength='100' class="txfield">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                             <a href="javascript:newEmail('adaptorLogEmail', 'font5')"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/addmore.gif" width="65" height="17" onMouseOver="window.status='Click to Add Notification Email';return true" onMouseout="window.status='';return true" title="Click here to Add Notification Email"></a>
                             </td></tr>
                <%
                        }
                    }
                %>

                </table>
            </td>
        </tr>

        <tr>
            <td align='left'><font class='NArialL'>&nbsp;</font></td>
            <td align='left' valign='center'><font id="font5"></font></td>
        </tr>

    
        <!-- Ship Alert Emails -- Start -->

        <tr><td colspan=2><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20></td></tr>

        <tr>
            <td bgcolor='#DEE1E2' align='left' width='150'><font class="NArialL">&nbsp;&nbsp;Send Ship Alerts To:</font></td>
            <td align='left' valign='center'>
                <table>
                <%
                    String[] shipAlertEmails = notificationSetup.getShipAlertEmails();
                    if ((shipAlertEmails == null) || (shipAlertEmails.length == 0)) {
                %>
                        <tr><td>
                            <input type="text" name="shipAlertEmail" size="50" maxlength='100' class="txfield">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <a href="javascript:newEmail('shipAlertEmail', 'font6')"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/addmore.gif" width="65" height="17" onMouseOver="window.status='Click to Add Notification Email';return true" onMouseout="window.status='';return true" title="Click here to Add Notification Email"></a>
                        </td></tr>
                <%
                    }
                    else {
                            int count = 0;
                            for (int i=0; i<shipAlertEmails.length; i++) {
                            if ( shipAlertEmails[i] != null && ( !"".equals(shipAlertEmails[i].trim()) ) )
                            {
                                count++;

                %>
                                <tr><td><input type="text" name="shipAlertEmail" value='<%=shipAlertEmails[i]%>' size="50" maxlength='100' class="txfield">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <%
                                if ( count > 1 )
                                {
                %>
                                    </td></tr>
                <%
                                }
                            }
                            if ( count == 1 )
                            {   count++;
                %>
                                <a href="javascript:newEmail('shipAlertEmail', 'font6')"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/addmore.gif" width="65" height="17" onMouseOver="window.status='Click to Add Notification Email';return true" onMouseout="window.status='';return true" title="Click here to Add Notification Email"></a>
                                </td></tr>
                <%
                            }
                        }
                        if (count == 0)
                        {
                %>
                            <tr><td><input type="text" name="shipAlertEmail" size="50" maxlength='100' class="txfield">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                             <a href="javascript:newEmail('shipAlertEmail', 'font6')"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/addmore.gif" width="65" height="17" onMouseOver="window.status='Click to Add Notification Email';return true" onMouseout="window.status='';return true" title="Click here to Add Notification Email"></a>
                             </td></tr>
                <%
                        }
                    }
                %>
                </table>
            </td>
        </tr>

        <tr>
            <td align='left'><font class='NArialL'>&nbsp;</font></td>
            <td align='left' valign='center'><font id="font6"></font></td>
        </tr>

    <!-- Ship Alert Emails -- END -->


          <!-- Sales Order Notification Emails -->

        <tr><td colspan=2><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20></td></tr>

        <tr>
            <td bgcolor='#DEE1E2' align='left' width='150'><font class="NArialL">&nbsp;&nbsp;Send Sales Order <br>&nbsp;&nbsp;Notifications To:</font></td>
            <td align='left' valign='center'>
                <table>
                <%
                    String[] salesOrderEmails = notificationSetup.getSalesOrderEmails();
                    if ((salesOrderEmails == null) || (salesOrderEmails.length == 0)) {
                %>
                        <tr><td>
                            <input type="text" name="salesOrderEmail" size="50" maxlength='100' class="txfield">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <a href="javascript:newEmail('salesOrderEmail', 'font7')"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/addmore.gif" width="65" height="17" onMouseOver="window.status='Click to Add Notification Email';return true" onMouseout="window.status='';return true" title="Click here to Add Notification Email"></a>
                        </td></tr>
                <%
                    }
                    else {
                            int count = 0;
                            for (int i=0; i<salesOrderEmails.length; i++) {
                            if ( salesOrderEmails[i] != null && ( !"".equals(salesOrderEmails[i].trim()) ) )
                            {
                                count++;

                %>
                                <tr><td><input type="text" name="salesOrderEmail" value='<%=salesOrderEmails[i]%>' size="50" maxlength='100' class="txfield">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <%
                                if ( count > 1 )
                                {
                %>
                                    </td></tr>
                <%
                                }
                            }
                            if ( count == 1 )
                            {   count++;
                %>
                                <a href="javascript:newEmail('salesOrderEmail', 'font7')"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/addmore.gif" width="65" height="17" onMouseOver="window.status='Click to Add Notification Email';return true" onMouseout="window.status='';return true" title="Click here to Add Notification Email"></a>
                                </td></tr>
                <%
                            }
                        }
                        if (count == 0)
                        {
                %>
                            <tr><td><input type="text" name="salesOrderEmail" size="50" maxlength='100' class="txfield">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                             <a href="javascript:newEmail('salesOrderEmail', 'font7')"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/addmore.gif" width="65" height="17" onMouseOver="window.status='Click to Add Notification Email';return true" onMouseout="window.status='';return true" title="Click here to Add Notification Email"></a>
                             </td></tr>
                <%
                        }
                    }
                %>

                </table>
            </td>
        </tr>

        <tr>
            <td align='left'><font class='NArialL'>&nbsp;</font></td>
            <td align='left' valign='center'><font id="font7"></font></td>
        </tr>
        <!-- Sales Order Notification Emails -- END -->


        <!-- Sales Order Porting Notification Emails -->

        <%--<tr><td colspan=2><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20></td></tr>

        <tr>
            <td bgcolor='#DEE1E2' align='left' width='150'><font class="NArialL">&nbsp;&nbsp;Send Sales Order <br>&nbsp;&nbsp;Porting Notifications To:</font></td>
            <td align='left' valign='center'>
                <table>
                <%
                    String[] salesOrderPortingEmails = notificationSetup.getSalesOrderPortingEmails();
                    if ((salesOrderPortingEmails == null) || (salesOrderPortingEmails.length == 0)) {
                %>
                        <tr><td>
                            <input type="text" name="salesOrderPortingEmail" size="50" maxlength='100' class="txfield">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <a href="javascript:newEmail('salesOrderPortingEmail', 'font8')"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/addmore.gif" width="65" height="17" onMouseOver="window.status='Click to Add Notification Email';return true" onMouseout="window.status='';return true" title="Click here to Add Notification Email"></a>
                        </td></tr>
                <%
                    }
                    else {
                            int count = 0;
                            for (int i=0; i<salesOrderPortingEmails.length; i++) {
                            if ( salesOrderPortingEmails[i] != null && ( !"".equals(salesOrderPortingEmails[i].trim()) ) )
                            {
                                count++;

                %>
                                <tr><td><input type="text" name="salesOrderPortingEmail" value='<%=salesOrderPortingEmails[i]%>' size="50" maxlength='100' class="txfield">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <%
                                if ( count > 1 )
                                {
                %>
                                    </td></tr>
                <%
                                }
                            }
                            if ( count == 1 )
                            {   count++;
                %>
                                <a href="javascript:newEmail('salesOrderPortingEmail', 'font8')"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/addmore.gif" width="65" height="17" onMouseOver="window.status='Click to Add Notification Email';return true" onMouseout="window.status='';return true" title="Click here to Add Notification Email"></a>
                                </td></tr>
                <%
                            }
                        }
                        if (count == 0)
                        {
                %>
                            <tr><td><input type="text" name="salesOrderPortingEmail" size="50" maxlength='100' class="txfield">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                             <a href="javascript:newEmail('salesOrderPortingEmail', 'font8')"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/addmore.gif" width="65" height="17" onMouseOver="window.status='Click to Add Notification Email';return true" onMouseout="window.status='';return true" title="Click here to Add Notification Email"></a>
                             </td></tr>
                <%
                        }
                    }
                %>

                </table>
            </td>
        </tr>

        <tr>
            <td align='left'><font class='NArialL'>&nbsp;</font></td>
            <td align='left' valign='center'><font id="font8"></font></td>
        </tr>--%>
        <!-- Sales Order Porting Notification Emails -- END -->


         <!-- Fab StageId Notification Emails -->

        <%--<tr><td colspan=2><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20></td></tr>

        <tr>
            <td bgcolor='#DEE1E2' align='left' width='150'><font class="NArialL">&nbsp;&nbsp;Send Stages <br>&nbsp; Notifications To:</font></td>
            <td align='left' valign='center'>
                <table>
                <%
                    String[] fabStageIdEmails = notificationSetup.getFabStageIdEmails();
                    if ((fabStageIdEmails == null) || (fabStageIdEmails.length == 0)) {
                %>
                        <tr><td>
                            <input type="text" name="fabStageEmail" size="50" maxlength='100' class="txfield">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <a href="javascript:newEmail('fabStageEmail', 'font9')"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/addmore.gif" width="65" height="17" onMouseOver="window.status='Click to Add fabStage Email';return true" onMouseout="window.status='';return true" title="Click here to Add fabStage Email"></a>
                        </td></tr>
                <%
                    }
                    else {
                            int count = 0;
                            for (int i=0; i<fabStageIdEmails.length; i++) {
                            if ( fabStageIdEmails[i] != null && ( !"".equals(fabStageIdEmails[i].trim()) ) )
                            {
                                count++;

                %>
                                <tr><td><input type="text" name="fabStageEmail" value='<%=fabStageIdEmails[i]%>' size="50" maxlength='100' class="txfield">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <%
                                if ( count > 1 )
                                {
                %>
                                    </td></tr>
                <%
                                }
                            }
                            if ( count == 1 )
                            {   count++;
                %>
                                <a href="javascript:newEmail('fabStageEmail', 'font9')"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/addmore.gif" width="65" height="17" onMouseOver="window.status='Click to Add fabStage Email';return true" onMouseout="window.status='';return true" title="Click here to Add fabStage Email"></a>
                                </td></tr>
                <%
                            }
                        }
                        if (count == 0)
                        {
                %>
                            <tr><td><input type="text" name="fabStageEmail" size="50" maxlength='100' class="txfield">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                             <a href="javascript:newEmail('fabStageEmail', 'font9')"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/addmore.gif" width="65" height="17" onMouseOver="window.status='Click to Add fabStage Email';return true" onMouseout="window.status='';return true" title="Click here to Add fabStage Email"></a>
                             </td></tr>
                <%
                        }
                    }
                %>

                </table>
            </td>
        </tr>
        --%>
        <tr>
            <td align='left'><font class='NArialL'>&nbsp;</font></td>
            <td align='left' valign='center'><font id="font9"></font></td>
        </tr>

        <tr><td colspan=2><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20></td></tr>

        <tr>
            <td bgcolor='#DEE1E2' align='left' width='150'><font class="NArialL">&nbsp;Sort Release Approval <br>&nbsp;Notifications To:</font></td>
            <td align='left' valign='center'>
                <table>
                <%
                    String[] sortReleaseEmails = notificationSetup.getSortReleaseEmails();
                    if ((sortReleaseEmails == null) || (sortReleaseEmails.length == 0)) {
                %>
                        <tr><td>
                            <input type="text" name="sortReleaseEmails" size="50" maxlength='100' class="txfield">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <a href="javascript:newEmail('sortReleaseEmails', 'font10')"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/addmore.gif" width="65" height="17" onMouseOver="window.status='Click to Add Sort Release Email';return true" onMouseout="window.status='';return true" title="Click here to Add Sort Release Email"></a>
                        </td></tr>
                <%
                    }
                    else {
                            int count = 0;
                            for (int i=0; i<sortReleaseEmails.length; i++) {
                            if ( sortReleaseEmails[i] != null && ( !"".equals(sortReleaseEmails[i].trim()) ) )
                            {
                                count++;

                %>
                                <tr><td><input type="text" name="sortReleaseEmails" value='<%=sortReleaseEmails[i]%>' size="50" maxlength='100' class="txfield">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <%
                                if ( count > 1 )
                                {
                %>
                                    </td></tr>
                <%
                                }
                            }
                            if ( count == 1 )
                            {   count++;
                %>
                                <a href="javascript:newEmail('sortReleaseEmails', 'font10')"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/addmore.gif" width="65" height="17" onMouseOver="window.status='Click to Add Sort Release Email';return true" onMouseout="window.status='';return true" title="Click here to Add sort Release Email"></a>
                                </td></tr>
                <%
                            }
                        }
                        if (count == 0)
                        {
                %>
                            <tr><td><input type="text" name="sortReleaseEmails" size="50" maxlength='100' class="txfield">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                             <a href="javascript:newEmail('sortReleaseEmails', 'font10')"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/addmore.gif" width="65" height="17" onMouseOver="window.status='Click to Add Sort Release Email';return true" onMouseout="window.status='';return true" title="Click here to Add sort Release Email"></a>
                             </td></tr>
                <%
                        }
                    }
                %>

                </table>
            </td>
        </tr>

        <tr>
            <td align='left'><font class='NArialL'>&nbsp;</font></td>
            <td align='left' valign='center'><font id="font10"></font></td>
        </tr>
        <!-- Fab StageId Notification Emails -- END -->

        <!-- PROGRAM RELEASE Notification Emails -->

       <%-- <tr><td colspan=2><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20></td></tr>

        <tr>
            <td bgcolor='#DEE1E2' align='left' width='150'><font class="NArialL">&nbsp;&nbsp;Send Program <br>&nbsp;&nbsp;Release  Notifications To:</font></td>
            <td align='left' valign='center'>
                <table>
                <%
                    String[] progReleaseEmails = notificationSetup.getProgramReleaseEmails();
                    if ((progReleaseEmails == null) || (progReleaseEmails.length == 0)) {
                %>
                        <tr><td>
                            <input type="text" name="programReleaseEmail" size="50" maxlength='100' class="txfield">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <a href="javascript:newEmail('programReleaseEmail', 'font11')"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/addmore.gif" width="65" height="17" onMouseOver="window.status='Click to Add Program Release Email';return true" onMouseout="window.status='';return true" title="Click here to Add Program Release Email"></a>
                        </td></tr>
                <%
                    }
                    else {
                            int count = 0;
                            for (int i=0; i<progReleaseEmails.length; i++) {
                            if ( progReleaseEmails[i] != null && ( !"".equals(progReleaseEmails[i].trim()) ) )
                            {
                                count++;

                %>
                                <tr><td><input type="text" name="programReleaseEmail" value='<%=progReleaseEmails[i]%>' size="50" maxlength='100' class="txfield">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <%
                                if ( count > 1 )
                                {
                %>
                                    </td></tr>
                <%
                                }
                            }
                            if ( count == 1 )
                            {   count++;
                %>
                                <a href="javascript:newEmail('programReleaseEmail', 'font11')"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/addmore.gif" width="65" height="17" onMouseOver="window.status='Click to Add Program Release Email';return true" onMouseout="window.status='';return true" title="Click here to Add Program Release Email"></a>
                                </td></tr>
                <%
                            }
                        }
                        if (count == 0)
                        {
                %>
                            <tr><td><input type="text" name="programReleaseEmail" size="50" maxlength='100' class="txfield">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                             <a href="javascript:newEmail('programReleaseEmail', 'font11')"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/addmore.gif" width="65" height="17" onMouseOver="window.status='Click to Add Program Release Email';return true" onMouseout="window.status='';return true" title="Click here to Add Program Release Email"></a>
                             </td></tr>
                <%
                        }
                    }
                %>

                </table>
            </td>
        </tr>

        <tr>
            <td align='left'><font class='NArialL'>&nbsp;</font></td>
            <td align='left' valign='center'><font id="font11"></font></td>
        </tr>
       --%> <!-- PROGRAM RELEASE Notification Emails -- END -->

        <!-- ASSEMBLY RELEASE Notification Emails -->

        <tr><td colspan=2><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20></td></tr>

        <tr>
            <td bgcolor='#DEE1E2' align='left' width='150'><font class="NArialL">&nbsp;&nbsp;Send Assembly <br>&nbsp;&nbsp;Release Notifications To:</font></td>
            <td align='left' valign='center'>
                <table>
                <%
                    String[] assemblyReleaseEmails = notificationSetup.getAssemblyReleaseEmails();
                    if ((assemblyReleaseEmails == null) || (assemblyReleaseEmails.length == 0)) {
                %>
                        <tr><td>
                            <input type="text" name="assemblyReleaseEmail" size="50" maxlength='100' class="txfield">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <a href="javascript:newEmail('assemblyReleaseEmail', 'font12')"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/addmore.gif" width="65" height="17" onMouseOver="window.status='Click to Add Assembly Release Email';return true" onMouseout="window.status='';return true" title="Click here to Add Assembly Release Email"></a>
                        </td></tr>
                <%
                    }
                    else {
                            int count = 0;
                            for (int i=0; i<assemblyReleaseEmails.length; i++) {
                            if ( assemblyReleaseEmails[i] != null && ( !"".equals(assemblyReleaseEmails[i].trim()) ) )
                            {
                                count++;

                %>
                                <tr><td><input type="text" name="assemblyReleaseEmail" value='<%=assemblyReleaseEmails[i]%>' size="50" maxlength='100' class="txfield">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <%
                                if ( count > 1 )
                                {
                %>
                                    </td></tr>
                <%
                                }
                            }
                            if ( count == 1 )
                            {   count++;
                %>
                                <a href="javascript:newEmail('assemblyReleaseEmail', 'font12')"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/addmore.gif" width="65" height="17" onMouseOver="window.status='Click to Add Assembly Release Email';return true" onMouseout="window.status='';return true" title="Click here to Add Assembly Release Email"></a>
                                </td></tr>
                <%
                            }
                        }
                        if (count == 0)
                        {
                %>
                            <tr><td><input type="text" name="assemblyReleaseEmail" size="50" maxlength='100' class="txfield">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                             <a href="javascript:newEmail('assemblyReleaseEmail', 'font12')"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/addmore.gif" width="65" height="17" onMouseOver="window.status='Click to Add Assembly Release Email';return true" onMouseout="window.status='';return true" title="Click here to Add Assembly Release Email"></a>
                             </td></tr>
                <%
                        }
                    }
                %>

                </table>
            </td>
        </tr>

        <tr>
            <td align='left'><font class='NArialL'>&nbsp;</font></td>
            <td align='left' valign='center'><font id="font12"></font></td>
        </tr>
        <!-- ASSEMBLY RELEASE Notification Emails -- END -->

        <!-- NEW LOT Flow Notification Emails -->

        <tr><td colspan=2><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20></td></tr>

        <tr>
            <td bgcolor='#DEE1E2' align='left' width='150'><font class="NArialL">&nbsp;&nbsp;Send Lot <br>&nbsp;&nbsp;Flow  Notifications To:</font></td>
            <td align='left' valign='center'>
                <table>
                <%
                    String[] newLotEmails = notificationSetup.getNewLotEmails();
                    if ( ( newLotEmails == null ) || ( newLotEmails.length == 0 ) ) {
                %>
                        <tr><td>
                            <input type="text" name="newLotEmail" size="50" maxlength='100' class="txfield">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <a href="javascript:newEmail('newLotEmail', 'font13')"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/addmore.gif" width="65" height="17" onMouseOver="window.status='Click to Add New Lot Email';return true" onMouseout="window.status='';return true" title="Click here to Add New Lot Email"></a>
                        </td></tr>
                <%
                    }
                    else {
                            int count = 0;
                            for (int i=0; i<newLotEmails.length; i++) {
                            if ( newLotEmails[i] != null && ( !"".equals(newLotEmails[i].trim()) ) )
                            {
                                count++;

                %>
                                <tr><td><input type="text" name="newLotEmail" value='<%=newLotEmails[i]%>' size="50" maxlength='100' class="txfield">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <%
                                if ( count > 1 )
                                {
                %>
                                    </td></tr>
                <%
                                }
                            }
                            if ( count == 1 )
                            {   count++;
                %>
                                <a href="javascript:newEmail('newLotEmail', 'font13')"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/addmore.gif" width="65" height="17" onMouseOver="window.status='Click to Add New Lot Email';return true" onMouseout="window.status='';return true" title="Click here to Add New Lot Email"></a>
                                </td></tr>
                <%
                            }
                        }
                        if (count == 0)
                        {
                %>
                            <tr><td><input type="text" name="newLotEmail" size="50" maxlength='100' class="txfield">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                             <a href="javascript:newEmail('newLotEmail', 'font13')"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/addmore.gif" width="65" height="17" onMouseOver="window.status='Click to Add New Lot Email';return true" onMouseout="window.status='';return true" title="Click here to Add New Lot Email"></a>
                             </td></tr>
                <%
                        }
                    }
                %>

                </table>
            </td>
        </tr>

        <tr>
            <td align='left'><font class='NArialL'>&nbsp;</font></td>
            <td align='left' valign='center'><font id="font13"></font></td>
        </tr>
        <!-- NEW LOT Notification Emails -- END -->

         <!-- REPORTS Flow Notification Emails -->

        <tr><td colspan=2><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20></td></tr>

        <tr>
            <td bgcolor='#DEE1E2' align='left' width='150'><font class="NArialL">&nbsp;&nbsp;Send Daily  <br>&nbsp;&nbsp;Reports To:</font></td>
            <td align='left' valign='center'>
                <table>
                <%
                    String[] reportsEmails = notificationSetup.getReportsEmails();
                    if ( ( reportsEmails == null ) || ( reportsEmails.length == 0 ) ) {
                %>
                        <tr><td>
                            <input type="text" name="reportsEmail" size="50" maxlength='100' class="txfield">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <a href="javascript:newEmail('reportsEmail', 'font14')"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/addmore.gif" width="65" height="17" onMouseOver="window.status='Click to Add Reports Email';return true" onMouseout="window.status='';return true" title="Click here to Add Reports Email"></a>
                        </td></tr>
                <%
                    }
                    else {
                            int count = 0;
                            for (int i=0; i<reportsEmails.length; i++) {
                            if ( reportsEmails[i] != null && ( !"".equals(reportsEmails[i].trim()) ) )
                            {
                                count++;

                %>
                                <tr><td><input type="text" name="reportsEmail" value='<%=reportsEmails[i]%>' size="50" maxlength='100' class="txfield">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <%
                                if ( count > 1 )
                                {
                %>
                                    </td></tr>
                <%
                                }
                            }
                            if ( count == 1 )
                            {   count++;
                %>
                                <a href="javascript:newEmail('reportsEmail', 'font14')"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/addmore.gif" width="65" height="17" onMouseOver="window.status='Click to Add Reports Email';return true" onMouseout="window.status='';return true" title="Click here to Add Reports Email"></a>
                                </td></tr>
                <%
                            }
                        }
                        if (count == 0)
                        {
                %>
                            <tr><td><input type="text" name="reportsEmail" size="50" maxlength='100' class="txfield">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                             <a href="javascript:newEmail('reportsEmail', 'font14')"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/addmore.gif" width="65" height="17" onMouseOver="window.status='Click to Add Reports Email';return true" onMouseout="window.status='';return true" title="Click here to Add Reports Email"></a>
                             </td></tr>
                <%
                        }
                    }
                %>

                </table>
            </td>
        </tr>

        <tr>
            <td align='left'><font class='NArialL'>&nbsp;</font></td>
            <td align='left' valign='center'><font id="font14"></font></td>
        </tr>
        <!-- REPORTS Notification Emails -- END -->


        <tr><td colspan=2><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=30></td></tr>
        <tr><td colspan=2 align='left'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <chiptrack:restrictedLink functionality='<%=Functionality.NOTIFICATION_SETUP%>' action='<%=User.USER_ACTION_MODIFY%>' href='javascript:saveEmails();' onmouseover="window.status='Click to Save Notification Emails';return true" onmouseout="window.status='';return true">
            <img border="0" src="<%=chipTracContext%>/jsp/includes/images/save.gif" title='Click to Save Notification Emails'/>
        </chiptrack:restrictedLink>
            <%--<a href="javascript:saveEmails()"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/save.gif" onMouseOver="window.status='Click to Save Notification Emails';return true" onMouseout="window.status='';return true" title="Click here to Save Notification Emails"  width="53" height="17"></a>--%>&nbsp;&nbsp;&nbsp;&nbsp;
            <a href="<%=chipTracContext%>/jsp/admin/admin.jsp"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/cancel.gif" onMouseOver="window.status='Click to Cancel';return true" onMouseout="window.status='';return true" title="Click here to Cancel" width="53" height="17"></a>
        </td></tr>
    </table>

</html:form>
<!-- till here -->

<BR><BR><BR></TD>
<TD bgcolor="#ffffff"><IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=1></TD>
</TR>
</TABLE>
<!-- Footer starts here -->
<%@ include file="/jsp/includes/footer.jsp" %>
<!-- footer end here -->

</BODY>
</HTML>